#!/usr/bin/env bash

# 处理工作进程的数量
WORKERS=$1
PYTHON_FILE="run"
PORT=8120
TIME_OUT=90


ps -ef | grep  $PYTHON_FILE | grep -v grep | awk '{print $2}' |xargs kill -9

cd ..

#nohup python start_invoice_cloud_server.py >> log.txt 2>&1 &

gunicorn -w $WORKERS  $PYTHON_FILE:app -b 0.0.0.0:$PORT --timeout=$TIME_OUT -k gevent --error-logfile=start_up_logs.txt --daemon